package Day04;
import java.util.Scanner;
public class NumCloumn {

	public static void main(String[] args) {
		/*
		Scanner scan = new Scanner(System.in);
		System.out.println("请输入整数(例如10):");
		double num = scan.nextInt();
		double sum = 0;
		String str = "";
		for(int i = 1,j = 1;i <= num;i++) {
			double temp = i + 1;
			if(i == 1) {
				sum = temp;
				str += i + "+" + j + "/";
			}else if(i < 15){
				sum /= temp;
				str += i + "+" + j + "/";
			}else {
				sum /= i;
				str += i + "=";
			}
			
		}
		System.out.print(str);
		System.out.println(sum);
		输出 1+1/2+1/3+1/4....+1/15=????
		*/
		
		int sum = 0;
		int num = 9;
		String str= "";
		for(int i = 1,j = 1; i <= 9; i++, j *= 10) {
			int temp = 0;
			for(int k = 1,g = 1;k <= i; k++, g *= 10) {
				temp += num*(j/g);
			}
			sum += temp;
			str += temp + "+";
		}
		System.out.print(str.substring(0,str.length()-1)+"="+sum);
//		输出9+99+999+9999+99999+999999+9999999+99999999+999999999=1111111101
	}

}
